import {BasePage, BaseInput, BaseRule} from "../../../../ts/type";
import {replace} from "../../../../ts/util";

export let entityColumnSaveInit = (page: BasePage) => {
    let saveModel = page.models.filter(m => 'save' == m.formKey)[0]

// field input auto
// #bind.field.tableCode#
  saveModel.formInputs.push(replace(new BaseInput('实体编码', 'tableCode'), {
    inputType: 'select',
    options: [],
    optionsUrl: '/au/entity/tableCode/select'
  }))
// $bind.field.tableCode$

// #bind.field.columnType#
  saveModel.formInputs.push(replace(new BaseInput('字段数据类型', 'columnType'), {
    span: 12,
    defaultValue: 'VARCHAR'
  }))
// $bind.field.columnType$

// #bind.field.columnLength#
  saveModel.formInputs.push(replace(new BaseInput('字段长度限制', 'columnLength'), {
    inputType: 'number',
    span: 12
  }))
// $bind.field.columnLength$

// #bind.field.columnPrecision#
  saveModel.formInputs.push(replace(new BaseInput('数字位数', 'columnPrecision'), {
    inputType: 'number',
    span: 12
  }))
// $bind.field.columnPrecision$

// #bind.field.columnScale#
  saveModel.formInputs.push(replace(new BaseInput('小数精度', 'columnScale'), {
    inputType: 'number',
    span: 12
  }))
// $bind.field.columnScale$

// #bind.field.columnNullable#
  saveModel.formInputs.push(replace(new BaseInput('字段null', 'columnNullable'), {
    span: 12
  }))
// $bind.field.columnNullable$

// #bind.field.fieldName#
  saveModel.formInputs.push(replace(new BaseInput('属性名称', 'fieldName'), {
    span: 12
  }))
// $bind.field.fieldName$

// #bind.field.columnName#
  saveModel.formInputs.push(replace(new BaseInput('字段名称', 'columnName'), {
    span: 12
  }))
// $bind.field.columnName$

// #bind.field.methodName#
  saveModel.formInputs.push(replace(new BaseInput('方法名称', 'methodName'), {
    span: 12
  }))
// $bind.field.methodName$

// #bind.field.simpleType#
  saveModel.formInputs.push(replace(new BaseInput('属性简单类型', 'simpleType'), {
    span: 12
  }))
// $bind.field.simpleType$

// #bind.field.fullType#
  saveModel.formInputs.push(replace(new BaseInput('属性完整类型', 'fullType'), {
    span: 12
  }))
// $bind.field.fullType$

// #bind.field.remark#
  saveModel.formInputs.push(replace(new BaseInput('属性备注', 'remark'), {
    span: 12
  }))
// $bind.field.remark$

// #bind.field.dataOrder#
  saveModel.formInputs.push(replace(new BaseInput('数据库排序', 'dataOrder'), {
    inputType: 'number',
    span: 12
  }))
// $bind.field.dataOrder$

// #bind.field.searchOrder#
  saveModel.formInputs.push(replace(new BaseInput('列表查询排序', 'searchOrder'), {
    inputType: 'number',
    span: 12
  }))
// $bind.field.searchOrder$

// #bind.field.formOrder#
  saveModel.formInputs.push(replace(new BaseInput('弹窗排序', 'formOrder'), {
    inputType: 'number',
    span: 12
  }))
// $bind.field.formOrder$

// #bind.field.pageColumnOrder#
  saveModel.formInputs.push(replace(new BaseInput('列表排序', 'pageColumnOrder'), {
    inputType: 'number',
    span: 12
  }))
// $bind.field.pageColumnOrder$

// #bind.field.searchExist#
  saveModel.formInputs.push(replace(new BaseInput('搜素是否启用', 'searchExist'), {
    span: 12
  }))
// $bind.field.searchExist$

// #bind.field.saveExist#
  saveModel.formInputs.push(replace(new BaseInput('新增是否启用', 'saveExist'), {
    span: 12
  }))
// $bind.field.saveExist$

// #bind.field.updateExist#
  saveModel.formInputs.push(replace(new BaseInput('更新是否启用', 'updateExist'), {
    span: 12
  }))
// $bind.field.updateExist$

// #bind.field.detailExist#
  saveModel.formInputs.push(replace(new BaseInput('详情是否启用', 'detailExist'), {
    span: 12
  }))
// $bind.field.detailExist$

// #bind.field.pageColumnExist#
  saveModel.formInputs.push(replace(new BaseInput('列表是否启用', 'pageColumnExist'), {
    span: 12
  }))
// $bind.field.pageColumnExist$

// #bind.field.fieldCode#
  saveModel.formInputs.push(replace(new BaseInput('字段编码', 'fieldCode'), {
    span: 12
  }))
// $bind.field.fieldCode$


// field rule auto
// #bind.field.tableCode#
  saveModel.rules.tableCode = new BaseRule()
// $bind.field.tableCode$

// #bind.field.columnType#
  saveModel.rules.columnType = new BaseRule()
// $bind.field.columnType$

// #bind.field.fieldName#
  saveModel.rules.fieldName = new BaseRule()
// $bind.field.fieldName$

// #bind.field.remark#
  saveModel.rules.remark = new BaseRule()
// $bind.field.remark$


}